package com.autoreassociate.service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

import com.autoreassociate.tool.ConnectionAssociateTool;

public class CaLifeCycleService extends Service {

	static public ConnectionAssociateTool connectionAssociateTool;
	
	@Override
	public void onCreate() {
		connectionAssociateTool = ConnectionAssociateTool.getInstance();
		
		if (connectionAssociateTool == null) {
			connectionAssociateTool = ConnectionAssociateTool.getInstance(this.getApplication().getApplicationContext());
		}
		
		
		super.onCreate();
	}
	
	@Override
	public IBinder onBind(Intent intent) {
		// TODO Auto-generated method stub
		
		//ConnectionAssociateTool connectionAssociateTool = ConnectionAssociateTool.getInstance(context.getApplicationContext());
		return null;
	}
	
	@Override
	public void onStart(Intent intent, int startId) {
		//Context.getApplicationContext();
		//Activity.getApplication();

		
		super.onStart(intent, startId);
	}
	
	@Override
	public void onDestroy() {
		connectionAssociateTool = null;
		super.onDestroy();
	}
	
	@Override
	protected void finalize() throws Throwable {
		connectionAssociateTool = null;
		super.finalize();
	}

}
